package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.OrderDDT;
import com.ruoyi.system.domain.OrderT;
import com.ruoyi.system.mapper.OrderMapper;
import com.ruoyi.system.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderDDT> implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public OrderT getAllById(Integer userId, Integer orderId) {
        OrderT allById = orderMapper.getAllById(userId, orderId);
        return allById;
    }

    @Override
    public List<OrderT> getAll(Integer userId) {
        List<OrderT> all = orderMapper.getAll(userId);
        return all;
    }

    @Override
    public Integer insertOrder(OrderT order) {
        Integer integer = orderMapper.insertOrder(order);
        return integer;
    }
}
